package cn.csg.iotplatform.module.system.controller.admin.user.vo.user;

import cn.csg.iotplatform.framework.excel.core.annotations.DictFormat;
import cn.csg.iotplatform.framework.excel.core.convert.DictConvert;
import cn.csg.iotplatform.module.system.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.Date;

/**
* @description: [用户管理]Excel导入 dto
* @author Mr.Z
* @date 2024/3/14 10:17
* @version: v2.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = false) // 设置 chain = false，避免用户导入有问题
public class UserImportExcelDto {

    @ExcelProperty("用户账号")
    private String username;

    @ExcelProperty("用户姓名")
    private String nickname;

    @ExcelProperty("所属部门")
    private String deptName;

    private Long deptId;

    @ExcelProperty("用户密码")
    private String password;

    @ExcelProperty("租户类型")
    private String isTenant;

    @ExcelProperty("工号")
    private String userNo;

    @ExcelProperty(value = "性别", converter = DictConvert.class)
    @DictFormat(DictTypeConstants.USER_SEX)
    private String sex;

    @ExcelProperty("手机")
    private String mobile;

    @ExcelProperty("邮箱")
    private String email;

    @Schema(description = "失效时间")
    @ExcelProperty("失效时间")
    private LocalDateTime expirationDate;

    @ExcelProperty("是否有效")
    private String isValid;

    @ExcelProperty("用户描述")
    private String remark;

    @ExcelProperty("elink账号")
    private String elink;

    @ExcelProperty("角色名称,多个使用短横线 - 拼接")
    private String roleNames;

}
